// pages/personal/aboutus/aboutus.js
var utils = require('../../../utils/util.js');
var WxParse = require('../../../wxParse/wxParse.js');
var httpUrl = getApp().globalData.httpUrl;
Page({

    /**
     * 页面的初始数据
     */
    data: {
        maxlength: 500,
        inputlength:0
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        // this.oNslideList();
    },
    //反馈
    formSubmit: function (e) {
        var that = this;
        console.log(e.detail.value);
        if (e.detail.value.textarea!=""){
            utils.http(httpUrl + "/mobile/common/feedback", {
                content: e.detail.value.textarea,
                type:2
            }, function (res) {
                if (res.state == 1) {
                    wx.showToast({
                        title: '反馈成功',
                   
                    })
                    setTimeout(function(){
                        wx.navigateBack({
                            delta: 1
                        })
                    },1000)
                   
                } else {
                    //utils.message(res.datas);
                }
            })
        }else{
            if (e.detail.value.textarea==""){
            wx.showToast({
                title: '请输入反馈的信息',
                image:"/images/error.png"
            })
            }
        }
        
    },
    //输入文本框获取长度
    bindTextAreaBlur: function (e) {
        var e = e.detail.value;
        this.setData({
            inputlength: e.length
        })
    },
})